﻿using System.Modules.Constants;

namespace System.Modules.SharePoint.Constants
{
    /// <summary>
    /// Hosts Constants to SP Query Templates.
    /// </summary>
    public class SPQueryTemplates : XmlTemplates
    {
        /// <summary>
        /// Field Ref Template with Lookup Id attribute
        /// </summary>
        public const string FIELD_REF_LOOKUP = "<FieldRef Name='{0}' LookupId='{1}' />";

        /// <summary>
        /// Field Ref Template without Lookup Id attribute
        /// </summary>
        public const string FIELD_REF_ORDER = "<FieldRef Name='{0}' Ascending='{1}'/>";

        /// <summary>
        /// Field Ref Template without Lookup Id attribute
        /// </summary>
        public const string FIELD_REF = "<FieldRef Name='{0}'/>";

        /// <summary>
        /// Value Template
        /// </summary>
        public const string VALUE = "<Value Type='{0}'>{1}</Value>";

        /// <summary>
        /// 
        /// </summary>
        public const string VALUE_INCLUDE_TIME = "<Value Type='{0}' IncludeTimeValue='{1}'>{2}</Value>";

        /// <summary>
        /// AND Template
        /// </summary>
        public const string AND = "<And>{0}{1}</And>";

        /// <summary>
        /// OR Template
        /// </summary>
        public const string OR = "<Or>{0}{1}</Or>";

        /// <summary>
        /// Where Template
        /// </summary>
        public const string DATE_RANGES_OVERLAP = "<DateRangesOverlap>{0}</DateRangesOverlap>";

        /// <summary>
        /// Where Template
        /// </summary>
        public const string WHERE = "<Where>{0}</Where>";

        /// <summary>
        /// Order By Template
        /// </summary>
        public const string ORDER_BY = "<OrderBy>{0}</OrderBy>";

        /// <summary>
        /// View Scope
        /// </summary>
        public const string VIEW_SCOPE = "Scope='{0}'";

        /// <summary>
        /// End Node
        /// </summary>
        public const string END_NODE = "<{0}/>";
    }
}
